package com.ivo.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ivo.model.Model;

@Entity
@org.hibernate.annotations.Entity(dynamicUpdate=true)
@Table (name = "PDM_D_AUTH_EMP")
public class EmployeeAuthority extends Model {

	private static final long serialVersionUID = -8829683331548728199L;
	
	private Long authEmpId;
	private Category category;
	private String userId;
	private AuthorityType authority;
		
	public EmployeeAuthority(){}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "AUTH_EMP_ID")
	public Long getAuthEmpId() {
		return authEmpId;
	}

	public void setAuthEmpId(Long authEmpId) {
		this.authEmpId = authEmpId;
	}
	
	@ManyToOne(cascade = {CascadeType.MERGE})
	@JoinColumn(name = "CATE_FK")
	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}
	
	@Column(name = "EMPLOYEE_FK")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@ManyToOne(cascade = {CascadeType.MERGE})
	@JoinColumn(name = "AUTH_TYPE_FK")
	public AuthorityType getAuthority() {
		return authority;
	}

	public void setAuthority(AuthorityType authority) {
		this.authority = authority;
	}

	
	
}
